package com.zq.mycloud.gateway.exception;

import com.zq.mycloud.gateway.util.I18nUtil;
import lombok.Data;

/**
 * @author ：zhang qiang
 * @package :com.zq.mycloud.gateway.exception
 * @date ：Created in 2020/11/21 上午12:55
 * @description：
 * @modified By：
 * @version: $
 */
@Data
public class CommonException extends RuntimeException {
    private static final long serialVersionUID = -1875957667748308552L;
    private String code;
    private String message;
    private String msg;

    public CommonException(String code, Object[] args) {
        this.code = code;
        this.message = I18nUtil.translateCode(code, args);
    }

    public CommonException(String code, String msg, Object[] args) {
        this.code = code;
        this.msg = msg;
        this.message = I18nUtil.translateCode(code, args);
    }

    public CommonException(String code) {
        this.code = code;
        this.message = I18nUtil.translateCode(code);
    }
}
